Fixes thuds in space and hats falling off

Fixes #2550 by adding a check for space turf at the location of the mob
before playing a bodyfall sound

Fixes #2494 by following @Carn's suggestion of determining whether a hat
will fall off based on its head cover and head hide flags.

Thank you @Razharas and @MrPerson for help with bitflags.

>Error checking merge status
:\

Thanks @Supersayu for providing a lot of this code.