ENH: Fix SyntaxError when matrix() is called with invalid string

The numpy.matrix constructor uses eval(str.translate(table)) to convert
input strings to numeric matrix contents. str.translate(table) will
return empty string if str consists only of invalid characters. This is
confusing, as one would expect an exception when trying to construct a
matrix from invalid input.

This fix makes sure eval() is only called if str is not empty.
Otherwise, TypeError is raised.