Fixes #6118

Adds a check for ```pinned.len``` to beds and closets/lockers.