rospy: shutdown hooks to be any callable object

This allows rospy shutdown hooks to be any callable object, instead of requiring they be actual functions or methods.