Fix mysql error when attempting to remove blocktype from deleted page

Thanks to @korvinszanto for helping with this, if a page somehow becomes deleted and the blocks still exist, when you attempt to remove the block, Block::getByID() tries to find the page and blows up with pretty mysql errors.
Adding in is_object just for the hell of it
Merge pull request #1628 from Mnkras/patch-3

Fix mysql error when attempting to remove blocktype from deleted page