tiny util for getting and setting deep object props safely