Measurement of thin film magnetostriction using field-dependent atomic force microscopy