Automatic Stub Avoidance for a Powered Prosthetic Leg over Stairs and Obstacles