Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
1f4693a8 SPIGOT-6168: Fix error with Player.getBedSpawnLocation when world is unloaded while server running