Add checking function for whether a buffer is pinned