Numpy needs MATHLIB=m to be set when installing or else an error
occurs (issue termux/termux-packages#10808). Since it needs such a
workaround to be installable through pip it makes sense to keep
package in official repositories.
We want the build.sh to be sourceable without errors, even if
variables like TERMUX_SCRIPTDIR and TERMUX_ON_DEVICE_BUILD are not
set, so move the code for getting python version and error if on
device to termux_step_pre_configure.