Japan's two main airlines ground their Boeing 787 Dreamliners after one was forced to make an emergency landing because of battery problems.