Spline: limit control point X co-ordinates to the graph area.

This fixes an oversight in the control point handling which allows
the X co-ordinate to be outside the range 0..1 if the width of the
graph (including margins) is less than the width of the display.

On my Nexus 4, without this fix, this problem occurs in landscape
mode when dragging a control point outside the graph area,
effectively onto the system buttons area. This bad X co-ordinate and
a lack of bounds checking causes an 'index out of range' exception to
be thrown from within Spline.getAppliedCurve().

The Y co-ordinate is already suitably handled; this commit copies and
adapts that handling for the X co-ordinate. It also adds the
necessary bounds checking to Spline.getAppliedCurve().

Change-Id: I325a1b6837927a6dd050b30209a7beeadf76d089