GRU implementation has different behavior with numpy.int64 than LSTM implementation
#### Code Sample, a copy-pastable example if possible

```python
# Your code here
from keras.models import Sequential
from keras import layers
import numpy as np

data_dim = 21
timesteps = 8
num_classes = 10
num_neurons = 32
num_neurons = np.int64(num_neurons)

def test_model_GRU(data_dim,timesteps,num_classes):
    # expected input data shape: (batch_size, timesteps, data_dim)
    model = Sequential()
    model.add(layers.GRU(num_neurons,
                         name='gru_1',
                         input_shape=(timesteps, data_dim,),
                         ))
    model.add(layers.Dense(10,
                           activation='softmax',
                           ))
    model.compile(loss='categorical_crossentropy',
                  optimizer='rmsprop',
                  metrics=['accuracy'])
    return model

def test_model_LSTM(data_dim,timesteps,num_classes):
    # expected input data shape: (batch_size, timesteps, data_dim)
    model = Sequential()
    model.add(layers.LSTM(num_neurons,
                         input_shape=(timesteps, data_dim,),
                         ))
    model.add(layers.Dense(10,
                           activation='softmax',
                           ))
    model.compile(loss='categorical_crossentropy',
                  optimizer='rmsprop',
                  metrics=['accuracy'])
    return model

# Generate dummy training data
x_train = np.random.random((1000, timesteps, data_dim))
y_train = np.random.random((1000, num_classes))

# Generate dummy validation data
x_val = np.random.random((100, timesteps, data_dim))
y_val = np.random.random((100, num_classes))


model = test_model_LSTM(data_dim,timesteps,num_classes)
model.fit(x_train, y_train,
          batch_size=64, epochs=5,
          validation_data=(x_val, y_val))

model = test_model_GRU(data_dim,timesteps,num_classes)
model.fit(x_train, y_train,
          batch_size=64, epochs=5,
          validation_data=(x_val, y_val))
```
#### Problem description

[this should explain **why** the current behavior is a problem and why the expected output is a better solution.]

This is a problem because you would expect to simply change the implementation from LSTM to GRU without having to change any other inputs to the model. This came up because I was getting some of my parameters from a pandas dataframe that had numpy.int64 dtypes. I recently wanted to try implementing a GRU and when I simply changed my exisiting LSTM implementation to GRU without changing anything else, I got the error from the GRU implementation. The other inputs like input_shape=() does not seem to care about numpy.int64 but the first argument specifying number of units does. Using Keras 2.1.5 as that is latest I can install easily. 

**Note**: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
I searched numpy.int64 and did not find anything. 
**Note**: Many problems can be resolved by simply upgrading `pandas` to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if `master` addresses this issue, but that is not necessary.

For documentation-related issues, you can check the latest versions of the docs on `master` here:

https://pandas-docs.github.io/pandas-docs-travis/

If the issue has not been resolved there, go ahead and file it in the issue tracker.

#### Expected Output
Same as the output for the LSTM case
#### Output of ``pd.show_versions()``

<details>

[paste the output of ``pd.show_versions()`` here below this line]
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.1.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.22.0
pytest: None
pip: 9.0.1
setuptools: 39.0.1
Cython: None
numpy: 1.14.2
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.1.0
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

</details>
