Adaptive control of a hand prosthesis